<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <meta content="text/html;charset=utf-8"></meta>
    <title${result.username}——个人中心</title>
    <link rel="stylesheet" href="/static/js/common/bootstrap/css/bootstrap.min.css"></link>
    <link rel="stylesheet" href="/static/js/common/layer/theme/default/layer.css"></link>
    <link rel="stylesheet" href="/static/css/base.css"></link>

    <script src="/static/js/common/jquery/jquery-3.2.1.min.js"></script>
    <script src="/static/js/common/layer/layer.js"></script>
    <script src="/static/js/base/base.js"></script>


    <style type="text/css">
        .navbar .nav > li .dropdown-menu {
            margin: 0;
        }
        .navbar .nav > li:hover .dropdown-menu {
            display: block;
        }
    </style>

    <script>

        //修改提交
        function modifyRecord() {
            var url = "${basePath}" + "/sys/user/userInfoModify";
            var modifyForm = $("#form_modify").serialize();
            // alert(modifyForm);

            $.ajax({
                type: "PUT",
                data: modifyForm,
                url: url,
                success: function (resultData) {
                    var code = resultData.code;
                    if(code == 0){
                        layer.msg("操作成功", {
                            icon: 6,//提示的样式
                            time: 2000, //2秒关闭（如果不配置，默认是3秒）//设置后不需要自己写定时关闭了，单位是毫秒
                        });
                    }else{
                        msgInfo(resultData.msg);
                    }
                },
                error: function errorInfo(resultData) {
                    alert("error:"+resultData.responseText);

                }
            });

        }

    </script>
</head>
<body>
 <@_top.top 1/>
<div class="container" style="padding-bottom: 15px;min-height: 300px; padding-top: 60px;">
    <div class="row">
        <@_left.user 2/>
        <div class="col-md-10 col-xs-10">
            <h2>个人信息</h2>
            <hr>
            <div class="modal-body" id="div_update">
                <form id="form_modify" class="form-horizontal" role="form">
                    <div class="form-group hidden">
                        <label for="firstname" class="col-sm-2 control-label">ID</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="userId" name="id" value="${result.id?default("")}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="firstname" class="col-sm-2 control-label">用户名</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="username_modify" name="username" placeholder="请输入用户名" value="${result.username?default("")}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="lastname" class="col-sm-2 control-label">密&nbsp;&nbsp;&nbsp;码</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="password_modify" value="${result.password?default("")}" name="password" placeholder="密码">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="firstname" class="col-sm-2 control-label">是否可用</label>
                        <div class="radio col-sm-10">
                            <label>
                                <input type="radio" name="isLocked" id="locked_modify" value="1" checked > 是
                            </label>
                            <label>
                                <input type="radio" name="isLocked" id="notLocked_modify" value="0" >否
                            </label>

                        </div>
                    </div>
                </form>
            </div>

            <div class="modal-footer">
                <button type="button" id="button_modify" onclick="modifyRecord()" class="btn btn-primary">
                    保存
                </button>
            </div>
        </div>
    </div>
</div>


<script src="/static/js/common/jquery/jquery-3.2.1.min.js"></script>
<script src="/static/js/common/bootstrap/js/bootstrap.min.js"></script>
</body>

</html>